package com.jinglin.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.jinglin.entity.dto.UserMessageExtendDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 用户消息表
 * </p>
 *
 * @author ${author}
 * @since 2025-04-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UserMessage对象", description="用户消息表")
public class UserMessage extends Model<UserMessage> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "消息ID自增")
    @TableId(value = "message_id", type = IdType.ASSIGN_ID)
    private String  messageId;

    @ApiModelProperty(value = "用户ID")
    private String userId;

    @ApiModelProperty(value = "主体ID")
    private String videoId;

    @ApiModelProperty(value = "消息类型")
    private Integer messageType;

    @ApiModelProperty(value = "发送人ID")
    private String sendUserId;

    @ApiModelProperty(value = "0:未读 1:已读")
    private Integer readType;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "扩展信息")
    private String extendJson;

    @ApiModelProperty(value = "删除为0 未删除为1")
    @TableLogic
    private Integer deleted;

    @TableField(exist = false)
    private UserMessageExtendDto extendDto;
    @TableField(exist = false)
    private String videoName;
    @TableField(exist = false)
    private String videoCover;
    @TableField(exist = false)
    private String sendUserName;
    @TableField(exist = false)
    private String sendUserAvatar;


    @Override
    protected Serializable pkVal() {
        return this.messageId;
    }

}
